﻿using MoviesRoom.Models;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;

namespace MoviesRoom.ViewModels.Model
{
    public class VoteModel
    {
        public string UserId { get; set; }

        [Required]
        public int FilmId { get; set; }

        [Required]
        [Range(1, 10, ErrorMessage = "Invalid Vote Value")]
        public double Value { get; set; }

        public Vote CreateVote()
        { 
            var entity = new Vote()
            {
                FilmId = this.FilmId,
                Value = this.Value
            };

            return entity;
        }
    }
}